package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_新闻表 实体类。
 *
 * @author 11987
 * @since 2025-04-02
 */
@Table(value = "LINDI_NEWS", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiNews extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 新闻ID
     */
    private Long newsId;

    /**
     * 新闻标题
     */
    private String newsTitle;

    /**
     * 新闻内容
     */
    private String newsContent;

    /**
     * 是否置顶 0否 1是
     */
    private Boolean newsTop;

    /**
     * 排序
     */
    private Integer newsSort;

    /**
     * 发布部门
     */
    private Long publishDeptId;

    /**
     * 发布人
     */
    private Long publishAuthorId;

    /**
     * 发布时间
     */
    private LocalDateTime publishTime;

    /**
     * 状态  0禁用 1正常
     */
    private Integer status;

    /**
     * 新闻封面图文件ID
     */
    private Long newsPicFileId;

    public LindiNews() {
    }

    public LindiNews(Long newsId, String newsTitle, String newsContent, Boolean newsTop, Integer newsSort, Long publishDeptId, Long publishAuthorId, LocalDateTime publishTime, Integer status, Long newsPicFileId) {
        this.newsId = newsId;
        this.newsTitle = newsTitle;
        this.newsContent = newsContent;
        this.newsTop = newsTop;
        this.newsSort = newsSort;
        this.publishDeptId = publishDeptId;
        this.publishAuthorId = publishAuthorId;
        this.publishTime = publishTime;
        this.status = status;
        this.newsPicFileId = newsPicFileId;
    }

    public Long getNewsId() {
        return newsId;
    }

    public void setNewsId(Long newsId) {
        this.newsId = newsId;
    }

    public String getNewsTitle() {
        return newsTitle;
    }

    public void setNewsTitle(String newsTitle) {
        this.newsTitle = newsTitle;
    }

    public String getNewsContent() {
        return newsContent;
    }

    public void setNewsContent(String newsContent) {
        this.newsContent = newsContent;
    }

    public Boolean getNewsTop() {
        return newsTop;
    }

    public void setNewsTop(Boolean newsTop) {
        this.newsTop = newsTop;
    }

    public Integer getNewsSort() {
        return newsSort;
    }

    public void setNewsSort(Integer newsSort) {
        this.newsSort = newsSort;
    }

    public Long getPublishDeptId() {
        return publishDeptId;
    }

    public void setPublishDeptId(Long publishDeptId) {
        this.publishDeptId = publishDeptId;
    }

    public Long getPublishAuthorId() {
        return publishAuthorId;
    }

    public void setPublishAuthorId(Long publishAuthorId) {
        this.publishAuthorId = publishAuthorId;
    }

    public LocalDateTime getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(LocalDateTime publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getNewsPicFileId() {
        return newsPicFileId;
    }

    public void setNewsPicFileId(Long newsPicFileId) {
        this.newsPicFileId = newsPicFileId;
    }

    public static LindiNewsBuilder builder() {
        return new LindiNewsBuilder();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiNews that = (LindiNews) o;
        return Objects.equals(newsId, that.newsId) &&
               Objects.equals(newsTitle, that.newsTitle) &&
               Objects.equals(newsContent, that.newsContent) &&
               Objects.equals(newsTop, that.newsTop) &&
               Objects.equals(newsSort, that.newsSort) &&
               Objects.equals(publishDeptId, that.publishDeptId) &&
               Objects.equals(publishAuthorId, that.publishAuthorId) &&
               Objects.equals(publishTime, that.publishTime) &&
               Objects.equals(status, that.status) &&
               Objects.equals(newsPicFileId, that.newsPicFileId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), newsId, newsTitle, newsContent, newsTop, newsSort, publishDeptId, publishAuthorId, publishTime, status, newsPicFileId);
    }

    @Override
    public String toString() {
        return "LindiNews{" +
                "newsId=" + newsId +
                ", newsTitle='" + newsTitle + '\'' +
                ", newsContent='" + newsContent + '\'' +
                ", newsTop=" + newsTop +
                ", newsSort=" + newsSort +
                ", publishDeptId=" + publishDeptId +
                ", publishAuthorId=" + publishAuthorId +
                ", publishTime=" + publishTime +
                ", status=" + status +
                ", newsPicFileId=" + newsPicFileId +
                '}';
    }

    public static class LindiNewsBuilder {
        private Long newsId;
        private String newsTitle;
        private String newsContent;
        private Boolean newsTop;
        private Integer newsSort;
        private Long publishDeptId;
        private Long publishAuthorId;
        private LocalDateTime publishTime;
        private Integer status;
        private Long newsPicFileId;

        public LindiNewsBuilder newsId(Long newsId) {
            this.newsId = newsId;
            return this;
        }

        public LindiNewsBuilder newsTitle(String newsTitle) {
            this.newsTitle = newsTitle;
            return this;
        }

        public LindiNewsBuilder newsContent(String newsContent) {
            this.newsContent = newsContent;
            return this;
        }

        public LindiNewsBuilder newsTop(Boolean newsTop) {
            this.newsTop = newsTop;
            return this;
        }

        public LindiNewsBuilder newsSort(Integer newsSort) {
            this.newsSort = newsSort;
            return this;
        }

        public LindiNewsBuilder publishDeptId(Long publishDeptId) {
            this.publishDeptId = publishDeptId;
            return this;
        }

        public LindiNewsBuilder publishAuthorId(Long publishAuthorId) {
            this.publishAuthorId = publishAuthorId;
            return this;
        }

        public LindiNewsBuilder publishTime(LocalDateTime publishTime) {
            this.publishTime = publishTime;
            return this;
        }

        public LindiNewsBuilder status(Integer status) {
            this.status = status;
            return this;
        }

        public LindiNewsBuilder newsPicFileId(Long newsPicFileId) {
            this.newsPicFileId = newsPicFileId;
            return this;
        }

        public LindiNews build() {
            return new LindiNews(newsId, newsTitle, newsContent, newsTop, newsSort, publishDeptId, publishAuthorId, publishTime, status, newsPicFileId);
        }
    }

}
